package me.shiqiang.im.service;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.Set;

/**
 * @author cuishiqiang
 * @date 2018/1/14 下午5:08
 */
@FeignClient(name = "im-http-service")
@RequestMapping("im/server")
@CacheConfig(cacheNames = "serverNode")
public interface ServerNodeClient {


    @GetMapping("{userId}/serverId")
    @Cacheable
    String getServerId(@PathVariable("userId") String userId);

    @GetMapping("groupServer/{groupId}")
    @Cacheable
    Set<String> getGroupServerIdSet(@PathVariable("groupId") String groupId);
}
